<?php

namespace Wantuch\SurveyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="surveys")
 */
class Survey
{
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(type="string", length=100)
     */
    protected $name;
    
    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    protected $createdAt;
    
    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    protected $updatedAt;
    
    /**
     * @ORM\OneToMany(targetEntity="Product", mappedBy="survey")
     **/
    private $products;
    
    /**
     * @ORM\OneToMany(targetEntity="ReferencedValue", mappedBy="survey")
     **/
    private $ReferencedValues;
    
    /**
     * @ORM\OneToMany(targetEntity="Invitation", mappedBy="survey")
     **/
    private $invitations;
    
    /**
     * @ORM\OneToMany(targetEntity="Result", mappedBy="survey")
     **/
    private $results;
    
    /**
     * @ORM\Column(type="text", nullable=true)
     */
    protected $overallResultArray;
    
    public function __toString()
    {
        return (string) $this->getName();
    }
    
    /**
     * @ORM\Column(type="text", nullable=true)
     */
    protected $pairs;
    
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Survey
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     * @return Survey
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return \DateTime 
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set updatedAt
     *
     * @param \DateTime $updatedAt
     * @return Survey
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

    /**
     * Get updatedAt
     *
     * @return \DateTime 
     */
    public function getUpdatedAt()
    {
        return $this->updatedAt;
    }
 

    /**
     * Add products
     *
     * @param \Wantuch\SurveyBundle\Entity\Product $products
     * @return Survey
     */
    public function addProduct(\Wantuch\SurveyBundle\Entity\Product $products)
    {
        $this->products[] = $products;

        return $this;
    }

    /**
     * Remove products
     *
     * @param \Wantuch\SurveyBundle\Entity\Product $products
     */
    public function removeProduct(\Wantuch\SurveyBundle\Entity\Product $products)
    {
        $this->products->removeElement($products);
    }

    /**
     * Get products
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getProducts()
    {
        return $this->products;
    }

    /**
     * Add invitations
     *
     * @param \Wantuch\SurveyBundle\Entity\Invitation $invitations
     * @return Survey
     */
    public function addInvitation(\Wantuch\SurveyBundle\Entity\Invitation $invitations)
    {
        $this->invitations[] = $invitations;

        return $this;
    }

    /**
     * Remove invitations
     *
     * @param \Wantuch\SurveyBundle\Entity\Invitation $invitations
     */
    public function removeInvitation(\Wantuch\SurveyBundle\Entity\Invitation $invitations)
    {
        $this->invitations->removeElement($invitations);
    }

    /**
     * Get invitations
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getInvitations()
    {
        return $this->invitations;
    }

    /**
     * Set pairs
     *
     * @param string $pairs
     * @return Survey
     */
    public function setPairs($pairs)
    {
        $this->pairs = $pairs;

        return $this;
    }

    /**
     * Get pairs
     *
     * @return string 
     */
    public function getPairs()
    {
        return $this->pairs;
    }

    /**
     * Set overallResultArray
     *
     * @param string $overallResultArray
     * @return Survey
     */
    public function setOverallResultArray($overallResultArray)
    {
        $this->overallResultArray = $overallResultArray;

        return $this;
    }

    /**
     * Get overallResultArray
     *
     * @return string 
     */
    public function getOverallResultArray()
    {
        return $this->overallResultArray;
    }

    /**
     * Add results
     *
     * @param \Wantuch\SurveyBundle\Entity\Result $results
     * @return Survey
     */
    public function addResult(\Wantuch\SurveyBundle\Entity\Result $results)
    {
        $this->results[] = $results;

        return $this;
    }

    /**
     * Remove results
     *
     * @param \Wantuch\SurveyBundle\Entity\Results $results
     */
    public function removeResult(\Wantuch\SurveyBundle\Entity\Result $results)
    {
        $this->results->removeElement($results);
    }

    /**
     * Get results
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getResults()
    {
        return $this->results;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->products = new \Doctrine\Common\Collections\ArrayCollection();
        $this->invitations = new \Doctrine\Common\Collections\ArrayCollection();
        $this->results = new \Doctrine\Common\Collections\ArrayCollection();
    }


    /**
     * Add ReferencedValues
     *
     * @param \Wantuch\SurveyBundle\Entity\ReferencedValue $referencedValues
     * @return Survey
     */
    public function addReferencedValue(\Wantuch\SurveyBundle\Entity\ReferencedValue $referencedValues)
    {
        $this->ReferencedValues[] = $referencedValues;

        return $this;
    }

    /**
     * Remove ReferencedValues
     *
     * @param \Wantuch\SurveyBundle\Entity\ReferencedValue $referencedValues
     */
    public function removeReferencedValue(\Wantuch\SurveyBundle\Entity\ReferencedValue $referencedValues)
    {
        $this->ReferencedValues->removeElement($referencedValues);
    }

    /**
     * Get ReferencedValues
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getReferencedValues()
    {
        return $this->ReferencedValues;
    }
}
